Digital video capabilities can be incorporated into a wide range of devices, including digital televisions, digital direct broadcast systems, wireless communication devices such as radio telephone handsets, wireless broadcast systems, personal digital assistants (PDAs), laptop or desktop computers, digital cameras, digital recording devices, video gaming devices, video game consoles, and the like. Digital video devices implement video compression techniques, such as MPEG-2, MPEG-4, or H.264/MPEG-4, Part 10, Advanced Video Coding (AVC), to transmit and receive digital video more efficiently. Video compression techniques perform spatial and temporal prediction to reduce or remove redundancy inherent in video sequences.
Video compression generally includes spatial prediction and/or temporal prediction. In particular, intra-coding relies on spatial prediction to reduce or remove spatial redundancy between video blocks within a given coded unit, which may comprise a video frame, a slice of a video frame, or the like. In contrast, inter-coding relies on temporal prediction to reduce or remove temporal redundancy between video blocks of successive coded units of a video sequence. For intra-coding, a video encoder performs spatial prediction to compress data based on other data within the same coded unit. For inter-coding, the video encoder performs motion estimation and motion compensation to track the movement of corresponding video blocks of two or more adjacent coded units.
A coded video block may be represented by prediction information that comprises a prediction mode and a predictive block size, and a residual block of data indicative of differences between the block being coded and a predictive block. In the case of inter-coding, one or more motion vectors are used to identify the predictive block of data, while in the case of intra-coding, the prediction mode can be used to generate the predictive block. Both intra-coding and inter-coding may define several different prediction modes, which may define different block sizes and/or prediction techniques used in the coding.
The video encoder may apply transform, quantization and entropy coding processes to further reduce the bit rate associated with communication of a residual block. Transform techniques may comprise discrete cosine transforms or conceptually similar processes, such as wavelet transforms, integer transforms, or other types of transforms. In a discrete cosine transform (DCT) process, as an example, the transform process converts a set of pixel values into transform coefficients, which represent the energy of the pixel values in the frequency domain. Quantization is applied to the transform coefficients, and generally involves a process that limits the number of bits associated with any given transform coefficient. Entropy coding comprises one or more processes that collectively compress a sequence of quantized transform coefficients.
Prior to the entropy coding process, a transformed video block of transform coefficients may be serialized by scanning the transform coefficients from a two-dimensional block into a one-dimensional vector. Typically, the scanning is performed in a zig-zag manner such that the transform coefficients in the upper-left part of a video block occur earlier in the one-dimensional vector and the transform coefficients in the lower-right part of a video block occur later. High energy transform coefficients typically reside near the upper left corner following the transform, so zig-zag scanning is effective to group non-zero transform coefficients near the beginning of the one-dimensional vector. The scanning order can significantly affect the level of compression that can be achieved in entropy coding.
Examples of entropy coding processes include content adaptive variable length coding (CAVLC) and context adaptive binary arithmetic coding (CABAC). CAVLC is one type of entropy coding technique supported by the ITU H.264/MPEG4 Part 10 AVC standard. CAVLC uses variable length coding (VLC) tables in a manner that effectively compresses serialized “runs” of quantized transform coefficients. CABAC is another type of entropy coding technique supported by the ITU H.264/MPEG4 Part 10 AVC standard. CABAC may involve several stages, including binarization, context model selection, and binary arithmetic coding. Many other types of entropy coding techniques also exist, and new entropy coding techniques will likely emerge in the future.
A video decoder may perform inverse entropy coding operations that correspond to the type of entropy coding used in the encoding process to reconstruct the one-dimensional vectors of transform coefficients. Inverse scanning may also be performed at the decoder to form two-dimensional blocks from received one-dimensional vectors of transform coefficients. The video decoder then inverse quantizes and inverse transforms the transform coefficients in a block to reconstruct residual pixel data. The video decoder may use decoded prediction information comprising a prediction mode, prediction size, and, in the case of inter coding, motion information to obtain the predictive video block. The video decoder may then combine the predictive block with the corresponding reconstructed residual block in order to generate a decoded sequence of video.